package com.yl.users.mapper

import com.baomidou.mybatisplus.core.mapper.BaseMapper
import com.yl.users.entity.CompanyPermissionsView
import com.yl.users.entity.CompanyRole
import com.yl.users.pojo.dto.CompanyPermissionsDto
import com.yl.users.pojo.dto.CompanyPermissionsViewDto
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Param
@Mapper
interface CompanyPermissionsViewMapper : BaseMapper<CompanyPermissionsView> {

    /**
     * 查询当前赋予的和不同的id
     * @param companyId
     * @return
     */
    fun selectDifferentPermissions(@Param("companyId") companyId: Long): MutableList<CompanyPermissionsViewDto>


    /**
     * 查询当前公司的所有权限id
     * @param companyId
     * @return
     */
    fun selectCompanyPermissionsAllIds(companyId: Long): MutableList<Long>

    /**
     * 查询当前公司的所有目录权限
     * @param companyId
     * @return
     */
    fun getCompanyPermViewDirectoryMenuList(companyId: Long): MutableList<CompanyPermissionsView>

    /**
     * 查询当前公司的所有权限id
     * @param companyId
     * @return
     */
    fun selectCompanyPermissionsAllCodes(companyId: Long): MutableList<CompanyPermissionsView>

    /**
     * 查询 角色-权限 树形图
     * @param role 角色id,公司id
     * @return
     */
    fun selectRolePermissionsTree(role: CompanyRole): MutableList<CompanyPermissionsDto>
}
